import type { FormItemProps } from 'antd';
import React from 'react';

export type BaseLoginProps = {
  /**
   * @desc 登录成功回掉
   */
  onSuccess: (result: Record<string, any>) => void;
  /**
   * @desc 登录失败回掉
   */
  onError?: (err: Error) => void;
};

export type formValue = {
  loginName: string;
  password: string;
  verifyCode?: string;
};

export interface SendMsmCodeProps {
  status: number;
  mobile: string | undefined;
  value: string | undefined;
  onChange: (value: string | undefined) => void;
  onStatusChange: (status: number) => void;
  onErrmsgChange: (msg: { type: FormItemProps<formValue>['validateStatus']; text: React.ReactNode }) => void;
}

export type AWSCProps = {
  onSuccess?: (data: AWSCModule.NCSuccessData) => void;
  onFail?: (data: AWSCModule.NCFailData) => void;
  onError?: (data: AWSCModule.NCErrorData) => void;
};
